package com.u.social.article.controller;


import com.u.social.article.service.IArticleLikesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Alex Wu
 * @since 2025-02-25
 */
@RestController
@RequestMapping("/article-likes")
public class ArticleLikesController {

    @Autowired
    private IArticleLikesService articleLikesService;

    @PostMapping("/user/{userId}/article/{articleId}/status/{status}")
    public Boolean like(@PathVariable Long userId, @PathVariable Long articleId,@PathVariable Integer status) {
        articleLikesService.saveLikeStatus(123L, userId, articleId, status);
        System.out.println("User " + userId + " liked article " + articleId);
        return true;
    }

}
